package RateModel

import (
	"time"
)

type RateRecord struct {
	ID          uint64    `gorm:"primaryKey;autoIncrement" json:"id"`
	FromCode    string    `gorm:"type:varchar(191);not null;comment:本位币编码" json:"fromCode"`
	ToCode      string    `gorm:"type:varchar(191);not null;comment:汇算币编码" json:"toCode"`
	Rate        string    `gorm:"type:varchar(191);not null;comment:汇率" json:"rate"`
	RateTime    string    `gorm:"type:varchar(191);not null;comment:汇率时间戳" json:"rateTime"`
	RateDate    time.Time `gorm:"type:datetime(3);default:null;comment:汇率日期" json:"rateDate"`
	CreatedTime time.Time `gorm:"type:datetime(3);default:null" json:"createdTime"`
	UpdatedTime time.Time `gorm:"type:datetime(3);default:null" json:"updatedTime"`
	CreatedBy   string    `gorm:"type:longtext" json:"createdBy"`
	UpdatedBy   string    `gorm:"type:longtext" json:"updatedBy"`
}

// TableName 设置表名
func (RateRecord) TableName() string {
	return "rate_record"
}

/*
添加索引信息

CREATE INDEX rate_record_from_code_IDX USING BTREE ON rates.rate_record (from_code);
CREATE INDEX rate_record_to_code_IDX USING BTREE ON rates.rate_record (to_code);
CREATE INDEX rate_record_rate_date_IDX USING BTREE ON rate_record (rate_date);

CREATE UNIQUE INDEX rate_record_from_code_IDX USING BTREE ON rate_record (from_code,to_code,rate_date);
*/
